
require(["../conf/config.js"], function(){
	require(["jquery", "common"], function($,com){
		$(function(){
			
			 $("#banner1").click(function () {
			            window.location.href="https://www.oneplus.com/cn/brand?from=homepage";//跳转
			        });
					
				let $erweima =$(".wechat-qr-code");
				let $new_wechat_icon =$(".new-wechat-icon");
					$new_wechat_icon.hover(function(){
						$erweima.css({
							display : "block"
						})
					},function(){
						
						$erweima.css({
							display : "none",
							
						})
					}) //鼠标划入划出出现二维码
					let $banner_button = $(".banner-button");
					let $style_black =$('.style-black');
					let $a_style_3 =$('.a-style-3');
					let $style_black_3 =$('.style-black-3');
						$banner_button.hover(function(){
						 $style_black.stop().animate({
							width: "100%"
							
						},200)
						
						console.log("asc")
						},function(){
							$style_black.stop().animate({
								width: "0%"
							
							},200)
						})
						
						$a_style_3.hover(function(){
						 $style_black_3.stop().animate({
							width: "100%"
							
						},200)
						
						console.log("asc")
						},function(){
							$style_black_3.stop().animate({
								width: "0%"
							
							},200)
						})
							//3
					//part1 
					//$('.opod-btn ');
					//$('#part1_style')
						$('.opod-btn ').hover(function(){
						 $('#part1_style').stop().animate({
							width: "100%"
							
						},200)
						
						},function(){
							$('#part1_style').stop().animate({
								width: "0%"
							
							},200)
						})			
					//在线客服		
					let $service =$("#foo-service-chat-for-sobot");				 
							//$('#service')
									 
						$service.hover(function(){
						 $('#service').stop().animate({
							width: "100%"
							
						},200)
						
						console.log("asc")
						},function(){
							$('#service').stop().animate({
								width: "0%"
							
							},200)
						})						 
						//			 
					let $sevenT =$(".nav-middle>li:nth-of-type(2)");
						let $timer1 ="";
						$sevenT.hover(function(){
								$('#sevenT').css({
									display : "block",
									display : "flex"
								})
							 
							 
						},function(){
							$timer1=setTimeout(function(){
								$('#sevenT').css({
									display : "none"
								}) 
							},50)
						})
						$("#sevenT").hover(function(){
							clearTimeout($timer1)
						},function(){
							$('#sevenT').css({
								display : "none"
							}) 
						})
						//sevenT二级菜单
						let $seven =$(".nav-middle>li:nth-of-type(3)");
						let $timer2 ="";
						$seven.hover(function(){
								$('#seven').css({
									display : "block",
									display : "flex"
								})
							 
							 
						},function(){
							$timer2=setTimeout(function(){
								$('#seven').css({
									display : "none"
								}) 
							},50)
						})
						$("#seven").hover(function(){
							clearTimeout($timer2)
						},function(){
							$('#seven').css({
								display : "none"
							}) 
						})
						//seven的二级菜单
						let $shopping =$(".nav-middle>li:nth-of-type(4)");
						let $timer3 ="";
						$shopping.hover(function(){
								$('#shopping').css({
									display : "block",
									display : "flex"
								})
							 
							 
						},function(){
							$timer3=setTimeout(function(){
								$('#shopping').css({
									display : "none"
								}) 
							},50)
						})
						$("#shopping").hover(function(){
							clearTimeout($timer3)
						},function(){
							$('#shopping').css({
								display : "none"
							}) 
						})
						//商场二级菜单
						$("#shop-button").hover(function(){
							$('#shop-style-color').stop().animate({
								width:'100%'
							},200);
						},function(){
							$('#shop-style-color').stop().animate({
								width:'0%'
							},200);
						})
						//ding按钮动画效果
						let $log=$('.icon-denglu');
						let timer4 ="";
						$log.hover(function(){
							$("#log-in").stop().show();
						},function(){
							timer4 =setTimeout(()=>{
								$("#log-in").stop().hide();
							},30)
							
						})
						$("#log-in").hover(function(){
							clearTimeout(timer4);
							$("#log-in").stop().show();
						},function(){
							$("#log-in").stop().hide();
						})
						//订单二级菜单效果
						let $go_shopping =$(".icon-Shoppingbag_B_px");
						let timer5 ="";
						$go_shopping.hover(function(){
							$("#go-shopping").stop().show();
						},function(){
							timer5 =setTimeout(()=>{
								$("#go-shopping").stop().hide();
								
							},10)
							
						})
						$("#go-shopping").hover(function(){
							$("#go-shopping").stop().show();
							clearTimeout(timer5);
							
						},function(){
							$("#go-shopping").stop().hide();
						})
						//购物车二级菜单
						$(".search-blow").click(function(){
							$(".nav-right").stop().animate({
								opacity: "0"
							},300)
							$(".nav-middle").stop().animate({
									opacity: "0"
							},300,function(){
									$("#check").stop().show()
							})
						
						})
						//搜索隐藏
						$("#XX").click(()=>{
							$("#check").stop().hide();
							$(".nav-right").stop().animate({
								opacity: "100"
							},200);
							$(".nav-middle").stop().animate({
								opacity: "100"
							});
						})
						//搜索显示
						$(".two-code").click(function(){
							$("body").css({
								overflow : "hidden"
							})
							$(".two-code").stop().animate({
								right: "0",
								opacity:"0"
							},300);
							$("#background-gray").stop().show();
							$("#Ewm").stop().animate({
								opacity: "1",
								top: "50%"
								
							},300)
							
						})//点二维码显示扫码
						$("#XXX").click(function(){
							$("body").css({
								overflow: 'visible'
							});
							$(".two-code").stop().animate({
								right: "70%",
								opacity:"1"
							},300);
							$("#Ewm").stop().animate({
								opacity: "0",
								top: "80%"
								
							},300,function(){
								$("#background-gray").stop().hide();
							})
							
						})
						//点击X隐藏二维码
						
					
						
		})//onload
	})
})